package org.tinygroup.sdpm.zhang.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.tinygroup.sdpm.zhang.business.inter.GoodsManager;
import org.tinygroup.sdpm.zhang.dao.inter.pojo.Goods;
import org.tinygroup.sdpm.zhang.service.inter.GoodsServiceInter;

import java.util.List;

@Component
public class GoodsServiceImpl implements GoodsServiceInter {

    @Autowired
    private GoodsManager goodsManager;

    @Override
    public Goods getGoodsByKey(String pk) {
        return goodsManager.getByKey(pk);
    }

    @Override
    public void deleteGoodsByKey(String pk) {
        goodsManager.deleteByKey(pk);
    }

    @Override
    public Goods addGoods(Goods goods) {
        return goodsManager.add(goods);
    }

    @Override
    public int editGoods(Goods goods) {
        return goodsManager.edit(goods);
    }
}
